1 IDENTIFICATION DIVISION
2 PROGRAM-ID Damped_Oscillator
14 ALIAS COEFFICIENT.1 InitialPosition
15 ALIAS COEFFICIENT.2 InitialSpeed
16 ALIAS COEFFICIENT.3 SpringForce
17 ALIAS COEFFICIENT.4 Damping # linear to speed
18 ALIAS COEFFICIENT.5 Mass # 1 / mass
21 # Colors being used for wiring
27 -1 -> InitialPosition -> -y0 # -initial position of the mass
28 -1 -> InitialSpeed -> y0s’ # y’ is scaled to be within -1..+1
29 +1, y0s’, y0s’ -> Summer -> y0’
31 y’’, IC:y0’ -> INTEGRATOR -> -y’
32 -y’,IC:-y0 -> INTEGRATOR -> y
33 y -> SpringForce -> S*y # springforce times displacement
35 y’ -> Damping -> D*y’ # damping times speed
36 10:S*y, 10:D*y’ -> SUMMER -> -(Dy’+Sy)
37 -(Dy’+Sy) -> Mass -> -1/m*(Dy’+Sy)=y’’